import { nanoid } from "nanoid";
const DEFAULT_MESSAGE = {
  menuType: 0,
  permissions: null,
  sort: 0,
  parentName: null,
};

/**
 * 本地路由
 * @params id 唯一id
 * @params pid 父id
 * @params children 子路由
 * @params name 路由名称
 */
export const localRouters = [
  {
    id: "1",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "1",
        children: [],
        name: "基础表格",
        url: "xxl-demo-example/el-table/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "1",
        children: [],
        name: "vue虚拟滚动插件",
        url: "xxl-demo-example/vue-xunni-scroll/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "1",
        children: [],
        name: "虚拟滚动列表",
        url: "xxl-demo-example/xunni-scroll/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "1",
        children: [],
        name: "上传用户头像",
        url: "xxl-demo-example/el-upload/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "1",
        children: [],
        name: "登录通过验证码",
        url: "xxl-demo-example/login-by-phone/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "1",
        children: [],
        name: "websocket功能",
        url: "xxl-demo-example/vue-websocket/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "示例",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
  {
    id: "2",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "2",
        children: [],
        name: "ag-grid展示表格",
        url: "xxl-ag-table/show-ag-able/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "2",
        children: [],
        name: "ag-grid编辑表格",
        url: "xxl-ag-table/edit-ag-able/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "2",
        children: [],
        name: "ag-grid变换表格",
        url: "xxl-ag-table/change-ag-able/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "ag配套",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
  {
    id: "3",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "3",
        children: [],
        name: "echarts柱状图",
        url: "xxl-echarts/columnar-echart/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "3",
        children: [],
        name: "echarts饼状图",
        url: "xxl-echarts/pie-shaped-echart/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "3",
        children: [],
        name: "echarts折线图",
        url: "xxl-echarts/line-echart/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "echarts库",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
  //插件
  {
    id: "4",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "4",
        children: [],
        name: "pdfjs-dist",
        url: "xxl-utils-demo/pdfjs-study/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "4",
        children: [],
        name: "vue-drag-resize",
        url: "xxl-utils-demo/vue-drag-resize/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "4",
        children: [],
        name: "v-viewer",
        url: "xxl-utils-demo/v-viewer/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "4",
        children: [],
        name: "date-fns",
        url: "xxl-utils-demo/date-fns/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "4",
        children: [],
        name: "导出excel",
        url: "xxl-utils-demo/out-excel/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "vue插件使用",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
  // javascript
  {
    id: "5",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "5",
        children: [],
        name: "数组api",
        url: "xxl-javascript/array-study/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "5",
        children: [],
        name: "对象api",
        url: "xxl-javascript/object-stusy/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "5",
        children: [],
        name: "字符串api",
        url: "xxl-javascript/string-study/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "5",
        children: [],
        name: "推送websocket",
        url: "xxl-javascript/websocket-study/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "javascript-api学习",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
  {
    id: "6",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "6",
        children: [],
        name: "vuex仓库学习",
        url: "xxl-vueYuFa/vue-store/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "6",
        children: [],
        name: "vue插槽学习",
        url: "xxl-vueYuFa/vue-slot/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "vue相关语法学习",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
  {
    id: "7",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "7",
        children: [],
        name: "角色模块",
        url: "xxl-springboot/role/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "7",
        children: [],
        name: "用户模块",
        url: "xxl-springboot/user/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "7",
        children: [],
        name: "实验增删改成的User模块",
        url: "xxl-springboot/testman/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "用户菜单角色管理权限",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
  {
    id: "8",
    pid: "0",
    children: [
      {
        id: nanoid(),
        pid: "8",
        children: [],
        name: "表格1",
        url: "hand-son-table/table-1/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
      {
        id: nanoid(),
        pid: "8",
        children: [],
        name: "表格2",
        url: "hand-son-table/table-2/index",
        icon: "icon-user",
        ...DEFAULT_MESSAGE,
      },
    ],
    name: "handsontable的基本使用",
    url: null,
    icon: "icon-safetycertificate",
    ...DEFAULT_MESSAGE,
  },
];
